package com.gjy.sb.util;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-08-19 20:19:09
 */
public class TmpUsage {

    public void cpu() {
        // 无限循环进行数学计算消耗CPU
        while (true) {
            // 计算斐波那契数列消耗CPU
            long result = fibonacci(30);
            System.out.println("Fibonacci result: " + result);
        }
    }

    private long fibonacci(int n) {
        if (n <= 1) return n;
        return fibonacci(n - 1) + fibonacci(n - 2);
    }

}
